package com.bifang.core.dao.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 角色表
 *
 * @author chenzh
 * @since 2020-12-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SYS_ROLE")
@ApiModel(value = "SysRole对象", description = "角色表")
public class DictSysRole extends Model<DictSysRole> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "角色id")
    @TableId(value = "ROLE_ID", type = IdType.INPUT)
    private String roleId;

    @ApiModelProperty(value = "角色名称")
    @TableField("ROLE_NAME")
    private String roleName;

    @ApiModelProperty(value = "描述")
    @TableField("REMARKS")
    private String remarks;

    @ApiModelProperty(value = "父角色id")
    @TableField("PARENT_ID")
    private String parentId;

    @ApiModelProperty(value = "角色分类")
    @TableField("ROLE_TYPE")
    private String roleType;

    @ApiModelProperty(value = "有效状态 0 禁用 1启用")
    @TableField("`STATUS`")
    private String status;

    @ApiModelProperty(value = "创建人")
    @TableField(
            value = "CREATE_NAME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @ApiModelProperty(value = "创建时间")
    @TableField(
            value = "CREATE_TIME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @ApiModelProperty(value = "修改人")
    @TableField(
            value = "UPDATE_NAME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @ApiModelProperty(value = "更新时间")
    @TableField(
            value = "UPDATE_TIME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除标志 0 正常 1 删除")
    @TableField(value = "DEL", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Override
    public Serializable pkVal() {
        return this.roleId;
    }
}
